home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Programming / amigatalk / intuition / GadgetActivation.st < prev    next >
Text File  |  2001-02-28  |  2KB  |  49 lines

  1. " ------------------------------------------------------------------- "
  2. " GadgetActivation Class is a Singleton class that allows the user to "
  3. " reference Gadget Activation flags without having to remember their  "
  4. " actual hexadecimal values.                                          "
  5. " ------------------------------------------------------------------- "
  6.  
  7. Class GadgetActivation :Dictionary ! uniqueInstance !
  8. [
  9.    privateNew ! newinstance !
  10.      newinstance <- super new.
  11.  
  12.      ^ newinstance
  13. |
  14.    new
  15.      ^ (self privateSetup)
  16. |
  17.    privateSetup
  18.      (uniqueInstance isNil)
  19.        ifTrue: [uniqueInstance <- self privateNew.
  20.  
  21.                 self at: #GACT_STRINGLEFT   put: 0. 
  22.                 self at: #GACT_RELVERIFY    put: 1.
  23.                 self at: #GACT_IMMEDIATE    put: 2.
  24.                 self at: #GACT_ENDGADGET    put: 4.
  25.                 self at: #GACT_FOLLOWMOUSE  put: 8.
  26.  
  27.                 self at: #GACT_RIGHTBORDER  put: 16r10.
  28.                 self at: #GACT_LEFTBORDER   put: 16r20.
  29.                 self at: #GACT_TOPBORDER    put: 16r40.
  30.                 self at: #GACT_BOTTOMBORDER put: 16r80.
  31.      
  32.                 self at: #GACT_TOGGLESELECT put: 16r100.
  33.                 self at: #GACT_STRINGCENTER put: 16r200.
  34.                 self at: #GACT_STRINGRIGHT  put: 16r400.
  35.                 self at: #GACT_LONGINT      put: 16r800.
  36.  
  37.                 self at: #GACT_ALTKEYMAP    put: 16r1000.
  38.                 self at: #GACT_BOOLEXTEND   put: 16r2000.
  39.                 self at: #GACT_STRINGEXTEND put: 16r2000.
  40.                 self at: #GACT_ACTIVEGADGET put: 16r4000.
  41.  
  42.                 "Neither set nor rely on this bit:"
  43.  
  44.                 self at: #GACT_BORDERSNIFF  put: 16r8000. 
  45.                ].
  46.                
  47.      ^ self "uniqueInstance??"
  48. ]
  49.